	function prn (name){
		
	var vPerson;
	var vBg='1';
		//alert($('#pRefDomains').val()+$('#pRefServices').val()+$('#pRefPerson').val()+name);
		if ($('#cId').val()!="") {
			vPerson=1;
		}
		else {
			vPerson=2;
		}
			
// 		alert ($('#cIdnp').val());
		switch (name)
		{
		  case 'ancheta': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefPerson').val()+name+'&printBackground=0','_blank',false);
			  //alert('ancheta'+$('#pIdContract').val()); 
		                    break;
		  case 'cerere': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefPerson').val()+name+'&printBackground=0','_blank',false);
		                    break;                  
		  case 'contract':
			  if ($('#pRefServices').val()==30 || $('#pRefServices').val()==31 || $('#pRefServices').val()==60 || $('#pRefDomains').val()==4) {vBg='0'};
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefDomains').val()+$('#pRefServices').val()+vPerson+name+'&printBackground='+vBg,'_blank',false);
			  //window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefDomains').val()+$('#pRefServices').val()+$('#pRefPerson').val()+name+'&printBackground=1','_blank',false);
		                    break;
		  case 'acord': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+vPerson+name+'&printBackground=1','_blank',false);
		                    break;     
		  case 'act': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+vPerson+$('#pRefDomains').val()+name+'&printBackground=1','_blank',false);
		                    break;      
		  case 'chitanta': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName=chitanta'+vPerson+'&printBackground=0','_blank',false);
		                    break;   
		  case 'cont': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName=cont2&printBackground=0','_blank',false);
		                    break;    
		  case 'fisc': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName=fisc2&printBackground=0','_blank',false);
		                    break;  
		  case 'transp': 
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName=transp2&printBackground=0','_blank',false);
		                    break; 
		  case 'cerereAs':
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefDomains').val()+$('#pRefServices').val()+vPerson+'cerere&printBackground=0','_blank',false);
		                    break;   
		  case 'polita':
			  window.open ('reports/generateContractItext?contractId='+$('#pIdContract').val()+'&contractTemplateName='+$('#pRefDomains').val()+$('#pRefServices').val()+vPerson+'polita&printBackground=0','_blank',false);
		                    break;                    
		}
		
		
	}